﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MINERP.DAL;
using MINERP.MODEL.FoundationModel;
using MINERP.MODEL.PrintManage;

namespace MINERP.BLL.Common
{
    public class PrinterBLL
    {
        public static List<Printer_Info> GetAllPrinters()
        {
            List<Printer_Info> list = new List<Printer_Info>();
            using (newSampleYPDBEntities db = new newSampleYPDBEntities())
            {
                List<printer> printerList = db.printer.ToList();
                //Printer_info info;
                foreach (printer printer in printerList)
                {
                    list.Add(new Printer_Info()
                    {
                        PrinterID = printer.PrinterID,
                        PName = printer.PName,
                        HotDirPath = printer.hotDirPath,
                        IsTransverse =(bool) printer.IsTransverse,
                        MonitorDirPath = printer.MonitorDirPath,
                        Status2 = (int)printer.status2,
                        PDes = printer.PDes,
                        PDPI = printer.PDPI,
                        PLength = printer.PLength,
                        Status = printer.status,
                        PWidth = printer.PWidth
                    });

                }

            }
            return list;
        }

      
    }
}
